package com.yuncommunity.runcircle.fragment;

import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.LinearLayout;

import com.yuncommunity.runcircle.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by oldfeel on 15-11-30.
 */
public class FindGps extends DialogFragment {
    @Bind(R.id.find_gps_info_1)
    LinearLayout findGpsInfo1;
    @Bind(R.id.find_gps_info_2)
    LinearLayout findGpsInfo2;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.find_gps, container, false);
        ButterKnife.bind(this, view);
        getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        return view;
    }

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                findGpsInfo1.setVisibility(View.GONE);
                findGpsInfo2.setVisibility(View.VISIBLE);
            }
        }, 5 * 1000);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
